<?php
class AppController extends Controller
{
	
	function beforeFilter() {

	    if(!empty($this->params['admin']) && $this->params['admin'] ==
	CAKE_ADMIN) {
	      $this->checkSession();
	    }

	}
	
    function checkSession()
    {
        // If the session info hasn't been set...
        if (!$this->Session->check('User'))
        {
            // Force the user to login
            $this->redirect('/users/login');
            exit();
        }
    }
}
?>